package com.greensecurity.sim.service.impl;

import com.greensecurity.sim.entity.User;
import com.greensecurity.sim.entity.UserMessage;
import com.greensecurity.sim.repository.UserMessageRepository;
import com.greensecurity.sim.service.UserMessageService;
import org.junit.Test;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserMessageServiceImpl implements UserMessageService {

    @Resource
    private UserMessageRepository userMessageRepository;

    @Override
    public List<UserMessage> findUserMessageByUserId(Long userId){
        return userMessageRepository.findByUserId(userId);
    }

    @Override
        public List<UserMessage> findUserMessageByUserIdAndIsRead(Long userId, Boolean isRead){
        return userMessageRepository.findByUserIdAndIsRead(userId,isRead);
    }


}
